package com.example.service.impl;

import com.example.dao.CommentDao;
import com.example.entity.Comment;
import com.example.service.CommentService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.List;

@Service
public class CommentServiceImpl implements CommentService {
    @Autowired
    private CommentDao commentDao;


    @Override
    public Comment addComment(Comment comment) {
        commentDao.addComment(comment);
        return comment;
    }

    @Override
    public List<Comment> getCommentsByGoodsId(int gid) {
        return commentDao.getCommentsByGoodsId(gid);
    }

    @Override
    public Comment getCommentById(int cid) {
        return commentDao.getCommentById(cid);
    }



}
